package j20251117;

import java.io.*;

public class Demo4 {
    public static void main(String[] args) throws IOException {
        try (OutputStream os = new FileOutputStream("output.txt")) {
            try (OutputStreamWriter osWriter = new OutputStreamWriter(os, "UTF-8")){
               try (PrintWriter writer = new PrintWriter(osWriter)) {
                writer.println("我是第⼀⾏");
                writer.print("我的第⼆⾏\r\n");
                writer.printf("%d: 我的第三⾏\r\n", 1 + 1);
                writer.flush();
               }
            }
        }
    }
}

